<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    class OperationAdd {
        doOperation(num1, num2) {
            return num1 + num2
        }
    }

    class OperationSubtract {
        doOperation(num1, num2) {
            return num1 - num2
        }
    }

    class OperationMultiply {
        doOperation(num1, num2) {
            return num1 * num2
        }
    }

    class Context {
        constructor(strategy) {
            this.strategy = strategy
        }

        executeStrategy(num1, num2) {
            return this.strategy.doOperation(num1, num2)
        }
    }

    const context = new Context(new OperationAdd())
    console.log(context.executeStrategy(1, 2));

    const context2 = new Context(new OperationSubtract())
    console.log(context2.executeStrategy(1, 2));

    const context3 = new Context(new OperationMultiply())
    console.log(context3.executeStrategy(1, 2));
</script>
</body>
</html>
